{if $smarty.session.user_isadmin == "1"}
<div class="wrap">

{if $resp_message == null}
	<div id="ajaxResponse" class="ajaxResponse"></div>
{else}
	<div id="ajaxResponse" class="ajaxResponse fade" style="display:block">{$resp_message}</div>
{/if}
<h2>Benutzerverwaltung</h2>
	<table class="widefat">
		<thead>
		{if $smarty.session.user_isadmin == "1"}
			<p>
			<a href="?module={$smarty.get.module}&sub1=UserList&act=newuser"><img src="../view/admin/images/object_create.png" alt="Create" /></a>
			</p>
		{/if}
		<tr>
			<th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1=UserList{/if}&sort=user_id&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_ID{/TranslateTag}</th>
			<th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1=UserList{/if}&sort=user_name&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_USERNAME{/TranslateTag}</th>
			<th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1=UserList{/if}&sort=user_firstname&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_USERFIRSTNAME{/TranslateTag}</th>
			<th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1=UserList{/if}&sort=user_lastname&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_USERLASTNAME{/TranslateTag}</th>
			<th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1=UserList{/if}&sort=user_email&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_EMAIL{/TranslateTag}</th>
			<th class="point {if $smarty.get.by eq 'desc'}sortover{else}sortoverup{/if}"  scope="col" onclick="javascript:document.location='?module={$smarty.get.module}{if $smarty.get.sub1}&sub1=UserList{/if}&sort=is_admin&by={if $smarty.get.by eq 'desc'}asc {else}desc{/if}'">{TranslateTag}B_LABEL_ADMINISTRATOR{/TranslateTag}</th>
	        {if $smarty.session.user_isadmin == "1"}
	        <th colspan="2" style="text-align: center">Aktionen</th>
	        {/if}
		</tr>
		</thead>
		<tbody id="thelist">
			{foreach name=user from=$USERS.data item=item}
				<tr id="user-{$item->user_id}" class="{cycle values=,alternate}">
					<th scope='row' style='text-align: left'>{$item->user_id}</th>
					<td align='left'>{$item->user_name}</td>
					<td align='left'>{$item->user_firstname}</td>
					<td align='left'>{$item->user_lastname}</td>
					<td align='left'>{$item->user_email}</td>
					<td align='left'>{if $item->is_admin == "1"}X{/if}</td>
					{if $smarty.session.user_isadmin == "1"}
					<td>
                        <a href="?module={$smarty.get.module}&sub1=edituser&id={$item->user_id}" class='edit'><img src="../view/admin/images/object_edit.png" alt="Edit" /></a>
                    </td>
                    	{if $smarty.session.user_id != $item->user_id}
						<td><a onclick="onDeleteUser('?module={$smarty.get.module}&sub1=UserList', '{$item->user_id}', 'ajaxResponse')" class='delete'>
							<img src="../view/admin/images/object_delete.png" alt="Delete" />
	                        </a>
	                    </td>
                   		{/if}
					{/if}
				</tr>
			{/foreach}
		</tbody>
	</table>
	{if $USERS.data != NULL}
     <div>			
              <div style="width:300px; float:left"> 
                  Seiten : {$USERS.TOTAL} von {$USERS.TOTALDATA}
              </div>			
              <div style="width:300px; text-align:right; float:right" >{$USERS.FIRST} {$USERS.PRE}&nbsp;{$USERS.LISTPAGE} von &nbsp; {$USERS.TOTALPAGE} &nbsp;                   
                  <select onchange="javascript:window.location='{$USERS.LINK}&{$USERS.PATHNAME}='+this.value">
                    {$USERS.COMBOPAGE}                     
                  </select>&nbsp;{$USERS.NEXT} {$USERS.LAST}         
              </div>
              <div style="clear:both"></div>		
    </div>	     
    {/if}
    {if $smarty.session.user_isadmin == "1"}
	    <p>
			<a href="?module={$smarty.get.module}&sub1=UserList&act=newuser"><img src="../view/admin/images/object_create.png" alt="Create" /></a>
		</p>
	{/if}
</div>
{/if}